"""
@Desc: https://akshare.akfamily.xyz/data/stock/stock.html
ak文档之神 获取数据就用ak

@Auth: meihongliang-m2
@Date: 2025/3/18-17:03
"""
import akshare as ak
import mplfinance as mpf


def main():
    print('akshare yyds')
    # stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date='20231022',
    #                                         adjust="")
    # print(stock_zh_a_hist_df)

    stock_sse_summary_df = ak.stock_sse_summary()
    print(stock_sse_summary_df)

    print('\n每日交易情况,上海证券交易所 Shanghai Stock Exchange 缩写SSE (A股)')
    print('A股面向国内投资者，以人民币交易；B股则面向境外投资者，以外币计价')
    # 每日交易情况 A股面向国内投资者，以人民币交易；B股则面向境外投资者，以外币计价
    stock_sse_deal_daily_df = ak.stock_sse_deal_daily(date="20250318")
    print(stock_sse_deal_daily_df)

    stock_zh_a_minute_df = ak.stock_zh_a_minute(symbol='sh600751', period='1', adjust="qfq")
    print(stock_zh_a_minute_df)


def xx():
    stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
    stock_us_daily_df = stock_us_daily_df.set_index(["date"])
    stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
    mpf.plot(stock_us_daily_df, type="candle", mav=(3, 6, 9), volume=True, show_nontrading=False)


if __name__ == '__main__':
    main()
    # test_2()
